home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / RxMUI / Examples / D&D.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2004-01-31  |  2.8 KB  |  96 lines

  1. /* How to handle drag and drop between 2 NList */
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. call Init
  7. call CreateApp
  8. call HandleApp
  9.  
  10. /***********************************************************************/
  11. Init:
  12.     l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  13.     if AddLibrary("rexxsupport.library","rxmui.library")~=0 then exit
  14.     call SetRxMUIStack(64000) /* Big stack for NList !*/
  15.     call RxMUIOpt("DebugMode ShowErr")
  16.     return
  17. /***********************************************************************/
  18. handleApp: procedure
  19.     ctrl_c=2**12
  20.     do forever
  21.         call NewHandle("app","h",ctrl_c)
  22.         if h.event="QUIT" then exit
  23.         else interpret h.event
  24.     end
  25. /* never reached */
  26. /***********************************************************************/
  27. CreateApp: procedure
  28.     app.Title="D&D"
  29.     app.Version="$VER: D&D 2.1 (25.1.2002)"
  30.     app.Copyright="Copyright © 2002 by Alfonso Ranieri"
  31.     app.Author="Alfonso Ranieri"
  32.     app.Description="D&D example"
  33.     app.Base="RXMUIEXAMPLE"
  34.     app.SubWindow="win"
  35.  
  36.      win.Title="D&D"
  37.      win.ID="MWIN"
  38.      win.Contents="mgroup"
  39.  
  40.       mgroup.0="bg"
  41.        bg.Class="Group"
  42.        bg.Horiz=1
  43.        bg.0=Button("remove","_Remove")
  44.        bg.1=Button("sort","_Sort")
  45.       mgroup.1="g"
  46.        g.Class="Group"
  47.        g.Horiz=1
  48.        g.0="listview1"
  49.         listview1.Class="NListview"
  50.         listview1.List="list1"
  51.          list1.Title="One|Two"
  52.          list1.TitleClick=2
  53.          list1.MultiSelect="Shifted"
  54.          list1.DragSortable=1
  55.          list1.DragType="Immediate"
  56.          list1.Format="BAR W=-1,BAR W=-1"
  57.          list1.MinColSortable=0
  58.          list1.TitleMark=0
  59.           list1.0="One|1"
  60.           list1.1="Two|2"
  61.           list1.2="Three|3"
  62.        g.1="listview2"
  63.         listview2.Class="NListview"
  64.         listview2.List="list2"
  65.          list2.DragSortable=1
  66.          list2.DragType="Immediate"
  67.          list2.Format="COL=1 BAR,COL=0 BAR"
  68.          list2.MultiSelect="Default"
  69.          list2.DragSortInsert=1
  70.           list2.0="Alfonso|Ranieri"
  71.           list2.1="Franco|Fiocca"
  72.           list2.2="Tiziana|Spognardi"
  73.           list2.3="Angelo|Barone"
  74.  
  75.     if NewObj("Application","app")>0 then exit
  76.  
  77.     call DandD("list2","list1","Auto")
  78.     call DandD("list1","list2","Auto")
  79.  
  80.     call Notify("win","closerequest",1,"app","returnid","quit")
  81.  
  82.     call Notify("sort","pressed",0,"list2","sort")
  83.     call Notify("remove","pressed",0,"list1","remove","active")
  84.  
  85.     call Notify("list1","titleclick","everytime","list1","sort2","triggervalue","add2values")
  86.     call Notify("list1","sorttype","everytime","list1","set","titlemark","triggervalue")
  87.  
  88.     call set("win","Open",1)
  89.  
  90.     return
  91. /***********************************************************************/
  92. halt:
  93. break_c:
  94.     exit
  95. /**************************************************************************/
  96.